package com.zzyk.microCloud.controller;
import com.zzyk.main.controller.BaseController;
import com.zzyk.main.configuration.exception.UserException;
import com.zzyk.main.model.pojo.Company;
import com.zzyk.main.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wss_PC
 * @DESCRIPTION 企业控制器
 * @create 2020-7-17
 */
@RestController
@RequestMapping("/company")
public class CompanyController extends BaseController {
    @Autowired
    private CompanyService companyService;

    /**
     * 根据获取企业信息
     *
     * @return
     */
    @GetMapping("/getCompanyById")
    public Company getCompanyById() throws UserException {
        return companyService.selectByPrimaryKey(currentUser().getEnterprise());
    }
}